package org.wolfengi.monitor.web;


import org.wolfengi.monitor.service.FShipTypeCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author wolfengi
 * @since 2020-05-20
 */
@Controller
@RequestMapping("/shipType")
public class FShipTypeCountController {

    @Autowired
    private FShipTypeCountService fShipTypeCountService;

    @RequestMapping("/years")
    @ResponseBody
    public List getYears() {
        List<String> list = fShipTypeCountService.selectYears();
        return list;
    }

    @RequestMapping("/count")
    @ResponseBody
    public List count(String year) {
        List<Map> maps = fShipTypeCountService.selectCountByYear(year);
        return maps;
    }
}
